package com.diankangwo.dao.impl;

import com.diankangwo.dao.ExpressCodeDAO;
import com.diankangwo.domain.ExpressCode;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Repository
public class ExpressCodeDAOImpl extends BaseDaoImpl<ExpressCode> implements ExpressCodeDAO {

    @Override
    public List<ExpressCode> findByName(String name) {
        List<ExpressCode> expressCodeList = new ArrayList<>();
        expressCodeList =  findByQuery("from ExpressCode e where e.name = ?", name);
        if (expressCodeList == null) {
            return null;
        }else{
            return expressCodeList;
        }
    }
}
